<?php


namespace App\Http\Controllers\Alipay;

use App\Http\Controllers\Controller;
use App\Services\AlipayMiniAppService;
use App\Services\CommonService;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;

class BaseVerifyController extends Controller
{

    public function __construct(Request $request)
    {
        $appId = intval($request->header("mini_id"));
        // 如果存在透传的miniId才需要去设置
        if ($appId > 0) {
            AlipayMiniAppService::getInstance()->setMiniId($appId);
        }
        /*if(empty($request)){
            $request = request();
        }
        $crypt = $request->header("crypt",'');
        $all = $request->all();
        if(isset($all['file'])){
            unset($all['file']);
        }
        $verify = apiVerify($all,$crypt,CommonService::API_SECRET_KEY);
        if(!$verify){
            echo json_encode(['status' => CommonService::HTTP_CODE_FAIL, 'msg' => '数据无权限', 'data' => []],JSON_UNESCAPED_UNICODE);exit;
        }*/

    }


}
